package com.dev;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.StateListDrawable;
import android.util.TypedValue;
import android.view.Gravity;
import android.widget.TextView;
import android.app.Application;
public class TextButton extends TextView{
	public int borderColor=MainActivity.CYAN;
	public int borderWidth=3;
	public boolean borderTop;
	public TextButton(MainActivity ma,String s){
		super(ma);
		setText(s);
		setTextSize(TypedValue.COMPLEX_UNIT_DIP,13);
		setTextColor(0xff000000);
		setGravity(Gravity.CENTER);
		StateListDrawable sd=new StateListDrawable();
		sd.addState(new int[]{android.R.attr.state_pressed},new ColorDrawable(0x77888888));
		setBackground(sd);
	}
	@Override
	protected void onDraw(Canvas canvas){
		super.onDraw(canvas);
		Paint p=new Paint();
		p.setColor(borderColor);
		if(borderTop)canvas.drawRect(0,0,getWidth(),borderWidth,p);
		canvas.drawRect(getWidth()-borderWidth,0,getWidth(),getHeight(),p);
	}
}
